<%@ page import="com.hkw.model.Student" %><%--
  Created by IntelliJ IDEA.
  User: 12244
  Date: 2020/8/31
  Time: 14:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>班级信息修改</title>
    <link rel="stylesheet" href="./css/bootstrap.min.css">
</head>
<body>
<%--表单回显相应学生的相关信息--%>
<form action="updateClassRoom" method="post" onsubmit="return check()">
    <div class="form-group" hidden="hidden">
        <label for="id1">班级编号</label>
        <input type="text" class="form-control" id="id1" name="id" value="${classroom.id}">
    </div>
    <div class="form-group">
        <label for="name1">班级名称</label>
        <input type="text" class="form-control" id="name1" name="name" value="${classroom.name}">
    </div>
    <div class="form-group">
        <label for="nianji">年级</label>
        <input type="text" id="nianji" class="form-control" name="grade" value="${classroom.grade}">
    </div>
    <div class="form-group">
        <label for="teaname">班主任名称</label>
        <input type="text" class="form-control" id="teaname"  name="classTeaName" value="${classroom.classTeaName}">
    </div>
    <div class="form-group">
        <label for="slogan1">口号</label>
        <input type="text" class="form-control" id="slogan1" name="slogan" value="${classroom.slogan}">
    </div>
    <div class="form-group" hidden="hidden">
        <label for="number1">人数</label>
        <input type="text" class="form-control" id="number1" name="number" value="${classroom.number}">
    </div>
    <button type="submit" class="btn btn-default" id="updateStudent">修改</button>
</form>
</body>
<script src="./js/jquery-3.3.1.min.js"></script>
<script src="./js/bootstrap.min.js"></script>
<script>
    //校验方法
    function check(){
        if($("#name1").val()==null||$("#name1").val().trim()==""){
            alert("班级名称不能为空!");
            return false;
        }else if($("#nianji").val()==null||$("#nianji").val().trim()==""){
            alert("年级不能为空!");
            return false;
        }else if($("#teaname").val()==null||$("#teaname").val().trim()==""){
            alert("班主任名称不能为空!");
            return false;
        }else if($("#slogan1").val()==null||$("#slogan1").val().trim()==""){
            alert("口号不能为空!");
            return false;
        }
        return true;
    }
</script>
</html>
